<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<h2>Project List</h2>
<%//Grab the username and password form the login page
String pstart_date=null;
String pname=null;
%>
<%
String query="SELECT name,start_date FROM project";
Connection db_conn = null;
Statement statement = null;
PreparedStatement pstmt;
ResultSet rs;
try{
Class.forName("com.mysql.jdbc.Driver");
String url= "jdbc:mysql://localhost:3306/db";
db_conn = DriverManager.getConnection( url,"root", "root" );
statement = db_conn.createStatement();
rs=statement.executeQuery(query);
while (rs.next()) { // parse the results
pname=rs.getString("name");
pstart_date=rs.getString("start_date");

out.println("<p><b>"+pstart_date+" &middot; "+"  "+ pname+"</b><br /></p>");
}
db_conn.close();
} catch(SQLException e){
e.printStackTrace();
out.println("sql not found");
out.println(e);
} catch(ClassNotFoundException e){
e.printStackTrace();
out.println(e);
}
%>


